var jsonsort = function (obj) {
  for (var i = 0; i < obj.length; i++) {
    for (var j = i + 1; j < obj.length; j++) {
      obj[i].layerIndex ? "" : (obj[i].layerIndex = 0);
      obj[j].layerIndex ? "" : (obj[j].layerIndex = 0);
      if (obj[i].layerIndex > obj[j].layerIndex) {
        var temp = obj[i];
        obj[i] = obj[j];
        obj[j] = temp;
      }
    }
    // if (obj[i].childre.length) this.jsonsort(obj[i].children);
  }
  return obj;
};
export { jsonsort };
